#ifndef GRAPHICSVIEW_H
#define GRAPHICSVIEW_H

#include "facecat/stdafx.h"
#include <QGraphicsView>
#include <QGraphicsObject>
#include <QGraphicsItem>
#include <QGraphicsScene>
#include <QPainter>
#include <QMouseEvent>
#include <QWheelEvent>
#include <QKeyEvent>
#include <QLineEdit>
#include "Win32/QtHost.h"
#include "Win32/QtPaint.h"

class FCGraphicsView;

class FCUIView:public QGraphicsObject{
public:
    FCGraphicsView *m_graphicsView;
public:
    FCUIView();
    virtual ~FCUIView();
    QRectF boundingRect() const override;
    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
};

class FCGraphicsView : public QGraphicsView{
Q_OBJECT
public:
    FCUIView *m_objectItem;
public:
    FCGraphicsView();
    virtual ~FCGraphicsView();
public:
    QtHost *m_host;
    FCNative *m_native;
    QtPaint *m_paint;
    QLineEdit *m_textBox;
    FCView *m_editingTextBox;
    double m_scaleFactor;
    int m_buttons;
    int m_clicks;
    void paint(QPainter *painter);
    void mousePressEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mouseDoubleClickEvent(QMouseEvent *event) override;
    void keyPressEvent(QKeyEvent *event) override;
    void keyReleaseEvent(QKeyEvent *event) override;
    void wheelEvent(QWheelEvent *event) override;
    void onLoad();
    void resetScaleSize(FCSize clientSize);
    void showTextBox(FCView *view, FCView *lastView);
    void hideTextBox(FCView *view);
};



#endif // GRAPHICSVIEW_H
